<div class="row">
  <div class="span3 bs-docs-sidebar ">
 	<*include file="<*$controller*>/location.tpl"*>
  </div>

<div class="alert span7" style=" margin-top:10px;">
  <strong>说明：</strong> 查询没孩子的家长
</div>

    <*if $result*>
    <div class="span7" >
<form action="/<*$controller*>/opclearparent" method="post" onsubmit="return checkhtml();"  id="f1" >    
   <table cellpadding="0" cellspacing="0" class="table">
		<tr> 
            <th class="span2">家长pid</th>
			<th class="span2">联系电话</th>
			<th class="span2">登陆帐号</th>
			<th class="span2">是否绑定手机</th>
			<th class="span2">是否登陆</th>
			<th class="span2"><input type="checkbox" title="全选" name="qxhtml" id="qxhtml" style="background:none" value="1" onclick="xuanhtml();"/></th>
			<th>&nbsp;</th>
		</tr>
      
    	<*foreach from=$result item=a key =key name=foo*>
		<tr> 
            <td><*$a.pid*></td>
			<td><*$a.mobile*></td>
			<td><*$a.username*></td>
			<td <*if $a.ischeck_mobile eq 1*>style="color:#F00;"<*/if*>><*if $a.ischeck_mobile eq 0*>否<*else*>是<*/if*></td>
			<td <*if $a.isinstalled eq 1*>style="color:#F00;"<*/if*>><*if $a.isinstalled eq 0*>否<*else*>是<*/if*></td>
			<td><label><input type="checkbox" <*if $a.ischeck_mobile eq 1*>disabled="disabled"<*/if*> style="float:left;background:none" onclick="checkedov(<*$a.pid*>)" name="htmlid[]" id="<*$a.pid*>" value="<*$a.pid*>" /></label>	
            <!--<input type="hidden" name="ischeck_mobile[<*$a.pid*>]" id="ischeck_mobile" value="<*$a.ischeck_mobile*>"/>-->            
            </td>
            <td>&nbsp;</td>
		</tr> 
		<*/foreach*>
         <tr><th colspan="6"><button type="submit" class="btn-large btn-primary span7" >删除</button></th></tr>
    </table>
	<input type="hidden" name="ischecked" id="ischecked" value="0"/>
    </div>
    <*else*>
    <div class="alert alert-info span7" style="margin-left:330px; margin-top:10px;">
    	<strong></strong> 没有脏数据！
    </div>
    <*/if*>	 
    
</div>
</div>
<script type="text/javascript">  
function checkhtml(){
	var checkboxs=document.getElementsByName("htmlid[]");
	var clength=checkboxs.length;
	var isc=0;
	for (var i=0;i<clength;i++) {
		var e=checkboxs[i].value;
		var es=document.getElementById(e);
		if(es.checked==true){
			isc=1;
		}
	}
	if(isc==0){
		alert('请选择！');
		return false;
	}
	return true;
}

function checkedov(id){
	var ischecked=document.getElementById("ischecked");
	var ids=document.getElementById(id);
	if(ids.checked==true){
		ischecked.value=1;
	}
}

function xuanhtml() {
	var qxhtml=document.getElementById("qxhtml");
	var checkboxs=document.getElementsByName("htmlid[]");
	var ischecked=document.getElementById("ischecked");
	if(qxhtml.checked==true){
		for (var i=0;i<checkboxs.length;i++) {
			var e=checkboxs[i];
			e.checked=true;
		}
		ischecked.value=1;
	}else{
		for (var i=0;i<checkboxs.length;i++) {
			var e=checkboxs[i];
			e.checked=false;
		}
		ischecked.value=0;
	}
}

</script>
